package com.ttai.presenter.activity;

import android.content.res.Resources;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.drawable.Drawable;
import android.widget.Toast;

import com.google.gson.JsonObject;
import com.ttai.R;
import com.ttai.model.dao.DBHelper;
import com.ttai.model.dao.bean.Id_Item;
import com.ttai.model.net.ResponseInfo;
import com.ttai.presenter.base.BasePresenter;
import com.ttai.ui.activity.EnterPage;
import com.ttai.ui.activity.LoginId;
import com.ttai.ui.activity.Register;

import java.util.ArrayList;

import retrofit2.Call;

public class LoginIdPresenter extends BasePresenter{
    LoginId loginId;


    public LoginIdPresenter(LoginId loginId) {
        this.loginId = loginId;
    }

    @Override
    protected void showError(String message) {
        Toast.makeText(loginId,message,Toast.LENGTH_SHORT).show();
    }

    @Override
    protected void parseJson(JsonObject json) {
        loginId.getLoginIdRecycleViewAdapter().notifyDataSetChanged();
        Toast.makeText(loginId,"删除成功",Toast.LENGTH_SHORT).show();
    }

    public void idDelete(String token,String appId,String account){
        Call<ResponseInfo> idInfo = responseInfoApi.iddelete(token, appId, account);
        idInfo.enqueue(new CallBackAdapter());
    }
}
